package org.bootstrap.controller;


import cn.hutool.core.lang.Console;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import org.springframework.web.bind.annotation.*;
import oshi.SystemInfo;
import oshi.hardware.HardwareAbstractionLayer;

import java.util.Properties;

@CrossOrigin
@RestController
@RequestMapping(method = RequestMethod.GET, value = "sys")
public class SystemController {
    private static SystemInfo systemInfo = new SystemInfo();

    // 返回服务器基本信息和日志
    @GetMapping("/info")
    public String base() {
        return null;
    }

    // 机器信息
    private static JSONObject machineInfo() {
        HardwareAbstractionLayer hardware = systemInfo.getHardware();// 获取硬盘
        Console.log(hardware.getComputerSystem());
        Console.log(hardware.getMemory().getTotal()/1024/1024);
        JSONObject info = JSONUtil.createObj();

        return null;
    }
}
